//这里用来读取所有的路由文件(除了自己)
const fs = require("fs");
const useRoutes = (app)=>{
  fs.readdirSync(__dirname).forEach(item=>{
    if(item !== 'index.js'){
        app.use(require("./"+item).routes());
        app.use(require("./"+item).allowedMethods());
    }
  });
}
module.exports = useRoutes;